package com.bussiness.dangnhap;

import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.bussiness.entity.DangNhaps;
import com.bussiness.server.db.util.AbstractDAS;

public class LoginDAS extends AbstractDAS<DangNhaps> {
	public final static Logger LOG = Logger.getLogger(LoginDAS.class);

	public boolean checkLogin(String userName, String password) {
		Criteria criteria = getSession().createCriteria(DangNhaps.class);
		criteria.add(Restrictions.eq("tenDN", userName));
		criteria.add(Restrictions.eq("matKhau", password));
		DangNhaps dangNhaps = (DangNhaps) criteria.uniqueResult();

		if (dangNhaps != null) {
			return true;
		} else {
			return false;
		}

	}
}
